#!/usr/bin/env python
# -*- coding: UTF-8 -*-
from rest_framework import serializers
from stuapi.models import Student


class StudentModelSerializers(serializers.ModelSerializer):
    class Meta:
        model = Student
        fields = "__all__"
        # fields = ["id", "name", "age", "classmate", "sex"]
        extra_kwargs = {
            "age": {
                "max_value": 29,
                "error_messages": {"max_value": "年纪不能超过29"}
            }
        }
